<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <script src="../js/flexible.debug.js"></script>
    <script src="../js/flexible_css.debug.js"></script>
    <link rel="stylesheet" href="../css/dengL.css">
</head>

<body>
    <header class="dl-header">
        <div class="header-left">
            <img src="../imgs/cha.png">
        </div>
    </header>
    <main class="dl-main">
        <figure class="logo-figure">
            <img src="../imgs/ailogo.png">
        </figure>
        <section class="ipt">
            <div class="ipt-top">
                <input type="email" placeholder="电子邮箱" class="username">
            </div>
            <div class="ipt-zhong">
                <input type="password" placeholder="密码" class="password">
            </div>
            <div class="ipt-bottom">
                <span>登录</span>
            </div>
        </section>
    </main>
    <footer class="dl-footer">
        <section>
            <p>
                <span>你还可以通过以下账号登录:</span>
            </p>
            <div>
                <p>
                    <img src="../imgs/wb.png">
                </p>
                <p>
                    <img src="../imgs/wx.png">
                </p>
            </div>
        </section>
    </footer>
    <script src="../js/jquery-2.2.4.min.js"></script>
    <script>
        $(document).ready(function() {
                    console.log({usrId:'1',nickname:'张三',mobile:'13311111111',pwd:'abc'}, {
                            usrId: '2',
                            nickname: '李四',
                            mobile: '13311111112',
                            pwd: 'abc1'
                        }, {
                            usrId: '3',
                            nickname: '王五',
                            mobile: '13311111113',
                            pwd: 'abc2'
                        }, {
                            usrId: '4',
                            nickname: '赵六',
                            mobile: '13311111114',
                            pwd: 'abc3'
                        }
                        )
                        $(".ipt-bottom").on('click', function() {
                            $.ajax({
                                    url: 'http://192.168.43.62:9998/login',
                                    type: 'post',
                                    dataType: 'json',
                                    data: {
                                        username: $(".username").val(),
                                        password: $(".password").val()
                                    }
                                })
                                .done(function(data) {
                                    console.log("success", data);
                                    alert(data.msg);
                                    if (data.code == 0) {} else {
                                        location.href = "msdl1.html";
                                    }
                                })
                                .fail(function() {
                                    console.log("error");
                                })
                                .always(function() {
                                    console.log("complete");
                                });
                        });
                    });

    </script>
</body>

</html>
